<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>智慧工地</title>
		<link rel="stylesheet" href="../css/mui.min.css" />
		<link rel="stylesheet" href="../css/master.css" />
		<link rel="stylesheet" href="../css/index.css" />
		<link rel="stylesheet" href="../libs/waitMe/waitMe.min.css">
		<!-- 遮罩css -->
	</head>

	<body>
		<!--图片轮播-->
		<div class="mui-collapse-content">
			<div id="slider" class="mui-slider">
				<div class="mui-slider-group mui-slider-loop">
					<!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
					<div class="mui-slider-item mui-slider-item-duplicate">
						<a class="zxxq">
							<img src="../images/banner4.jpg">
						</a>
					</div>
					<!-- 第一张 -->
					<div class="mui-slider-item">
						<a class="zxxq">
							<img src="../images/banner1.jpg">
						</a>
					</div>
					<!-- 第二张 -->
					<div class="mui-slider-item">
						<a class="zxxq">
							<img src="../images/banner2.jpg">
						</a>
					</div>
					<!-- 第三张 -->
					<div class="mui-slider-item">
						<a class="zxxq">
							<img src="../images/banner3.jpg">
						</a>
					</div>
					<!-- 第四张 -->
					<div class="mui-slider-item">
						<a class="zxxq">
							<img src="../images/banner4.jpg">
						</a>
					</div>
					<!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
					<div class="mui-slider-item mui-slider-item-duplicate">
						<a class="zxxq">
							<img src="../images/banner1.jpg">
						</a>
					</div>
				</div>
				<div class="mui-slider-indicator">
					<div class="mui-indicator mui-active"></div>
					<div class="mui-indicator"></div>
					<div class="mui-indicator"></div>
					<div class="mui-indicator"></div>
				</div>
				<div class="home_banner_layer">
					<img src="../images/home_banner_layer.png" />
				</div>
			</div>
		</div>

		<!--9宫格-->
		<div class="mui-content row m_top10">
			<ul class="mui-table-view mui-grid-view mui-grid-9">
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4 spjk">
					<a>
						<span class="mui-icon mui-icon-picture"><img src="../images/mui-grid-nine_01.png"/></span>
						<div class="mui-media-body">视频监控</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4 rygl">
					<a>
						<span class="mui-icon mui-icon-picture"><img src="../images/mui-grid-nine_02.png"/></span>
						<div class="mui-media-body">人员管理</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4 clgl">
					<a>
						<span class="mui-icon mui-icon-picture"><img src="../images/mui-grid-nine_03.png"/></span>
						<div class="mui-media-body">车辆管理</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4 aqgl">
					<a>
						<span class="mui-icon mui-icon-picture"><img src="../images/mui-grid-nine_05.png"/></span>
						<div class="mui-media-body">安全管理</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4 hjgl">
					<a>
						<span class="mui-icon mui-icon-picture"><img src="../images/mui-grid-nine_08.png"/></span>
						<div class="mui-media-body">环境监测</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4 xtgl">
					<a>
						<span class="mui-icon mui-icon-picture"><img src="../images/mui-grid-nine_04.png"/></span>
						<div class="mui-media-body">系统管理</div>
					</a>
				</li>
			</ul>
		</div>

		<!--头条-->
		<div class="mui-row headlines row m_top10">
			<div class="mui-col-xs-1 mui-col-sm-1 headlines-icon">
				<img src="../images/headlines-icon.png" />
			</div>
			<div id="scrollDiv" class="mui-col-xs-10 mui-col-sm-10 headlines-news">
				<ul>
					<li class="tt">李尔亚洲总部大楼已完成大底板混泥土浇筑工作</li> 
				</ul>
			</div>
		</div>
		<div id="app">
		<!--group_block-->
		<div class="mui-table-view-cell group_block">
			<a class="mui-navigate-right rkcd">
				<h3 class="mui-pull-left">入口车道信息</h3>
				<span class="mui-pull-right">查看更多</span>
			</a>
		</div>
		<div class="mui-content pb_70">
			<ul class="mui-table-view group_list">
				<li class="mui-table-view-cell mui-media" v-for="item in items">
					<a class="zxxq" href="javascript:;">
						<div class="mui-pull-left group_list_picture_box">
							<img class="mui-media-object group_team_picture" v-bind:src="item.carPath">
						</div>
						<div class="mui-media-body">
							<div class="mui-row">
								<div class="mui-col-xs-11 mui-col-sm-11 textCon">
									<h5>车牌号：{{item.carNumber}}</h5>
									<p class='mui-ellipsis'>进入时间：{{item.carTime}}</p>
								</div>
							</div>
						</div>
					</a>
				</li>
			</ul>
		</div>

		<!--group_block-->
		<div class="mui-table-view-cell group_block" style="margin-top: -60px;">
			<a class="mui-navigate-right ckcd">
				<h3 class="mui-pull-left">出口车道信息</h3>
				<span class="mui-pull-right">查看更多</span>
			</a>
		</div>
		<div class="mui-content pb_70">
			<ul class="mui-table-view group_list">
				<li class="mui-table-view-cell mui-media" v-for="item in items2">
					<a class="zxxq" href="javascript:;">
						<div class="mui-pull-left group_list_picture_box">
							<img class="mui-media-object group_team_picture" v-bind:src="item.carPath">
						</div>
						<div class="mui-media-body">
							<div class="mui-row">
								<div class="mui-col-xs-11 mui-col-sm-11 textCon">
									<h5>车牌号：{{item.carNumber}}</h5>
									<p class='mui-ellipsis'>进入时间：{{item.carTime}}</p>
								</div>
							</div>
						</div>
					</a>
				</li>
			</ul>
		</div>
		</div>
		<!--foot-->
		<nav class="mui-bar mui-bar-tab mui-bottom">
			<a class="mui-tab-item index mui-active">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item fx">
				<span class="mui-icon mui-icon-find"></span>
				<span class="mui-tab-label">人员管理</span>
			</a>
			<a class="mui-tab-item cl" href="#">
				<span class="mui-icon mui-icon-service"></span>
				<span class="mui-tab-label">车辆管理</span>
			</a>
			<a class="mui-tab-item xt">
				<span class="mui-icon mui-icon-set"></span>
				<span class="mui-tab-label">系统管理</span>
			</a>
		</nav>
	</body>

	<script src="../js/jquery.min.js"></script>
	<script src="../js/mui.min.js"></script>
	<script src="../libs/waitMe/waitMe.min.js"></script>
	<script src="../js/setting.js"></script>
	<script src="../js/common.js"></script>
	<script src="../js/vue.min.js"></script>
	<script>
		var h = mui(document).common();
 
		var app = new Vue({
			el: '#app',
			data: {
				items: [],
				items2: []
			},
			methods: {
				loginClick: function() {
					login(this.username, this.userpwd);
				}
			}
		})
		
		mui.plusReady(function() { //如果需要调用plus
			searchList("进"); //初始化
			searchList("出"); //初始化
		});
 
		function searchList(getOut) {
			var xhr = null;
			var url = setting.ip + "car/v1/CarSelectAPI?page=1&pageSize=5";
			var data = {
				"getOut":   getOut
			};
			xhr = new plus.net.XMLHttpRequest();
			xhr.open("POST", url);
			xhr.setRequestHeader('Content-Type', 'application/json');
			xhr.send(JSON.stringify(data));
			xhr.onreadystatechange = function() {
				if(xhr.readyState == 4) {
					if(xhr.status == 200) {
						if(getOut=="进"){
							app.items = eval('(' + xhr.responseText + ')');
						}else{
							app.items2 = eval('(' + xhr.responseText + ')');
						}
					}
				}
			}
		}

		//首页返回键处理
		//处理逻辑：1秒内，连续两次按返回键，则退出应用；
		var showMenu = false;
		var first = null;
		mui.back = function() {
			if(showMenu) {
				closeMenu();
			} else {
				//首次按键，提示‘再按一次退出应用’
				if(!first) {
					first = new Date().getTime();
					mui.toast('再按一次退出应用');
					setTimeout(function() {
						first = null;
					}, 2000);
				} else {
					if(new Date().getTime() - first < 1000) {
						plus.runtime.quit();
					}
				}
			}
		};
		
		//点击入口车道查询更多
		mui(".rkcd").on('tap', '.mui-pull-right', function(e) {
			var htype = {
				obj: this,
				url: 'car/entrance/entrance.html',
				id: 'entrance'
			}
			h.eachClick(htype);
		});
		
		//点击出口车道查询更多
		mui(".ckcd").on('tap', '.mui-pull-right', function(e) {
			var htype = {
				obj: this,
				url: 'car/exit/exit.html',
				id: 'exit'
			}
			h.eachClick(htype);
		});
		
		//点击视频监控
		mui(".mui-table-view").on('tap', '.spjk', function(e) {
			var htype = {
				obj: this,
				url: 'surveillance/surveillance.html',
				id: 'surveillance'
			}
			h.eachClick(htype);
		});

		//点击人员管理
		mui(".mui-table-view").on('tap', '.rygl', function(e) {
			var htype = {
				obj: this,
				url: 'personnel/personnelList.html',
				id: 'personnelList'
			}
			h.eachClick(htype);
		});

		//点击车辆管理
		mui(".mui-table-view").on('tap', '.clgl', function(e) {
			var htype = {
				obj: this,
				url: 'car/car.html',
				id: 'car'
			}
			h.eachClick(htype);
		});

		//点击安全管理
		mui(".mui-table-view").on('tap', '.aqgl', function(e) {
			var htype = {
				obj: this,
				url: 'safety/safety.html',
				id: 'safety'
			}
			h.eachClick(htype);
		});


		//点击环境检测
		mui(".mui-table-view").on('tap', '.hjgl', function(e) {
			var htype = {
				obj: this,
				url: 'environment/environment.html',
				id: 'environment'
			}
			h.eachClick(htype);
		});
		
		//点击系统管理
		mui(".mui-table-view").on('tap', '.xtgl', function(e) {
			var htype = {
				obj: this,
				url: 'system/system.html',
				id: 'system'
			}
			h.eachClick(htype);
		});

		//点击底部人员管理
		mui(".mui-bottom").on('tap', '.fx', function(e) {
			var htype = {
				obj: this,
				url: 'personnel/personnelList.html',
				id: 'personnelList'
			}
			h.eachClick(htype);
		});

		//点击底部车辆管理
		mui(".mui-bottom").on('tap', '.cl', function(e) {
			var htype = {
				obj: this,
				url: 'car/car.html',
				id: 'car'
			}
			h.eachClick(htype);
		});

		//点击底部系统管理
		mui(".mui-bottom").on('tap', '.xt', function(e) {
			var htype = {
				obj: this,
				url: 'system/system.html',
				id: 'system'
			}
			h.eachClick(htype);
		});
	</script>

</html>